package com.javasea.spring.starter.config2;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.ImportSelector;
import org.springframework.core.annotation.MergedAnnotation;
import org.springframework.core.type.AnnotationMetadata;

import java.lang.annotation.Annotation;
import java.util.Set;

@Slf4j
public class GpDefineImportSelector implements ImportSelector {
    @Override
    public String[] selectImports(AnnotationMetadata annotationMetadata) {
        // spring的自动注入原理是在这里通过SpringFactoriesLoader加载spring.factories来实现自动注入
        // 参考：https://www.shuzhiduo.com/A/qVdeo1w8JP/
        return new String[]{CacheService.class.getName(), LoggerService.class.getName()};
    }
}
